package com.ewanghuiju.app.ui.my.adapter;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ewanghuiju.app.R;
import com.ewanghuiju.app.model.bean.local.FansInfoBean;
import com.ewanghuiju.app.util.StringUtil;
import com.makeramen.roundedimageview.RoundedImageView;

/**
 * @author sj  qq:751943509
 * @class 我的团队新增列表 adapter
 * @time 2020/2/20
 */
public class MyTeamListAdapter extends BaseQuickAdapter<FansInfoBean, BaseViewHolder> {

    public MyTeamListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    protected void convert(BaseViewHolder helper, FansInfoBean item) {

        helper.setText(R.id.tv_nickname, StringUtil.getLengthTextByStr(item.getNickname(), 8));

        helper.setText(R.id.tv_vip_info, StringUtil.getDailiInfo(item.getIs_daili()));
        //直属粉丝
        helper.setText(R.id.tv_zs_fans, item.getDirectly_fans());
        //粉丝级别
        helper.setText(R.id.tv_fans_level, item.getPath_path());
        //时间
        helper.setText(R.id.tv_time, item.getCreate_time());
        //订单数量
        helper.setText(R.id.tv_order_num, item.getBuy_num());
        RoundedImageView riv = helper.getView(R.id.riv_head);
        Glide.with(mContext).load(item.getAvatar()).placeholder(R.mipmap.icon_default_head).error(R.mipmap.icon_default_head).into(riv);
    }
}
